<?php

session_start();
error_reporting(E_ALL);
ini_set("display_errors", 0);
setlocale(LC_ALL, 'tr_TR.UTF-8');
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

require_once $_SERVER['DOCUMENT_ROOT'] . "/libs.inc.php";
require_once $_SERVER['DOCUMENT_ROOT'] . '/view/menu/index.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/constants/Constants.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/portal/DAO/CountryDAO_Class.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/portal/DAO/LeagueDAO_Class.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/portal/DAO/SeasonDAO_Class.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/portal/DAO/TeamDAO_Class.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/portal/DAO/PersonDAO_Class.php';


///////////////////////////////////////
$countryDAO = new CountryDAO();
$leagueDAO = new LeagueDAO();
$seasonDAO = new SeasonDAO();
$teamDAO = new TeamDAO();
$personDAO = new PersonDAO();
////////////////   Default page ///////////////////



header('Content-type: text/html; charset=utf-8');
$smarty->display("menu/menu.tpl");
$countries = $countryDAO->loadAll();
foreach ($countries as $country) {
    $options = array($country->getId() => $country->getName());
}

$leagues = $leagueDAO->loadAll();
foreach ($leagues as $league) {
    $Loptions = array($league->getId() => $league->getName());
}

foreach ($teamDAO->loadAll() as $team) {
    $teamso = array($team->getId() => $team->getName());
}

$smarty->assign('status_radios', array(
    'ACTIVE' => 'Aktif',
    'PASSIVE' => 'Pasif'));
$smarty->assign('type_radios', array(
    'LEAGUE' => 'Lig',
    'TOURNAMENT' => 'Turnuva'));
$smarty->assign('position_radios', array(
    'GOALKEEPER' => 'Kaleci',
    'DEFENDERS' => 'Defans',
    'MIDFIELDERS' => 'Orta Saya',
    'FORWARD' => 'Forvet',
    'NONE' => 'Hiçbiri'));
$smarty->assign('types_radios', array(
    'PLAYER' => 'Oyuncu',
    'TRAINER' => 'Teknik Direktör',
    'PRESIDENT' => 'Başkan'));


$smarty->assign("countries", $options);
$smarty->assign("leagues", $Loptions);
$smarty->assign("teams", $teamso );
///////////////////////////////////////
?>
